<template>
  <div class="section_common">
    <div class="main">
      <!--<el-form ref="form" label-width="100px">
        <el-form-item label="类型">
          <el-input v-model="qtype" size="mini"></el-input>
        </el-form-item>
        <el-form-item label="标题">
          <el-input v-model="title" size="mini"></el-input>
        </el-form-item>
        <el-form-item label="内容">
          <el-input type="textarea" v-model="content" :autosize="{ minRows: 2, maxRows: 6}" ></el-input>
        </el-form-item>
       </el-form>-->
      <div class="edit_post">
        <div class="post_type_area">
          <div style="font-size: 10px">发布用户：{{applyName}}>>时间：{{createdTime}}>>类型：{{qtype}}</div>
          <!--<div class="title">类型</div>
          <el-input v-model="qtype" size="mini" label-width="200px"></el-input>-->
        </div>
        <div class="title">
          {{title}}
          <!--<div class="title">标题</div>
          <input
                  type="text"
                  v-model="title"
                  placeholder="标题"
          />-->
        </div>
        <div class="content">
          <div>{{content}}</div>
          <!--<div class="title">内容</div>
						<textarea
                                v-model="content"
                                placeholder="内容描述"
                        ></textarea>-->
        </div>

        <div class="img_area">
            <el-image
                    v-for="(item,index) in images"
                    :key="index"
                    style="width: 150px; height: 150px; margin-left: 20px"
                    :src="item"
                    :preview-src-list="[srcList[index]]">
            </el-image>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import Vue from 'vue';
  import { Image as VanImage ,Picker,Popup,Dialog} from 'vant';
  Vue.use(Picker);
  Vue.use(Popup);
  Vue.use(VanImage);
  Vue.use(Dialog)
export default {
  data() {
    return {
      nowUser:JSON.parse(localStorage.getItem('userInfo')).userId,
      id:this.$route.params.id,

      title:'',
      content:'',
      qtype:'',
      applyName:'',//创建人
      createdTime:'',//创建时间
      images:[],
      srcList:[]

    };
  },

  created() {
    this.getDetail();//找到对应的页面详情，及领导信息
  },

  methods: {

    //根据传递的招聘申请id获取相应的申请信息
    getDetail(){
      //console.log(id)
      this.$https.post('/mobiles/getSearchQuestionDetail', {
        nowUser:this.nowUser,
        id:this.id,
      }).then((res)=>{
        if (res.data.code=='200'){
          this.title=res.data.data.title;
          this.content=res.data.data.content;
          this.qtype=res.data.data.qtype;
          this.applyName=res.data.data.applyName;
          this.createdTime=res.data.data.createdTime;
          this.images=res.data.data.imgmid;
          this.srcList=res.data.data.img;
        }


      }).catch(err => {
        console.log(err);
      })
    },



  },
};
</script>

<style lang="scss" scoped>
  .main{
    margin-top: 20px;
    min-width: 320px;
  }
  .edit_post {
    width: 100%;
    display: flex;
    flex-flow: column nowrap;
    & > div {
      width: 100%;
      margin-bottom: 20px;
    }
    .title {
      font-weight: bold;
      font-size: 20px;
    }
    .content {
      textarea {
        width: 100%;
        border: none;
        min-height: 100px;
        padding: 10px;
        border: 1px solid rgba(0, 0, 0, 0.1);
      }
    }
  }
  .disabled .el-upload--picture-card {
    display: none !important;
  }
  .post_type_area {

    display: flex;

    /*.title {
      margin-right: 10px;
    }
    .el-input{
      width: 200px;
    }*/
  }
</style>